# $DEBUG = 1
require 'test/unit'
# require 'amazon_fps'
require '../lib/amazon_fps'

class TestAmazonFPS < Test::Unit::TestCase
  
  def setup
    @credentials = {
     'AWSAccessKeyId' => 'abc123'
    }
    
    @options = {
      # NOTE: change this to your cert subject as per 
      #  `openssl x509 -in aws.cer -subject`
      :subject => '/C=US/O=Amazon.com/OU=AWS-Developers/CN=bogus',
      :certificate_dir => File.join(File.dirname(__FILE__), '..', 'certs')
    }
    
    @fps = AmazonFPS.new(@credentials, @options, true)
  end
  
  # obj.getAccountBalance(body)
  def test_get_account_balance
    ret = @fps.getAccountBalance(AmazonFPS::GetAccountBalance.new).getAccountBalanceResult
    assert_not_nil ret
    assert_equal 'GetAccountBalanceResult', ret.class.to_s
    assert_equal [ "@accountBalance" ].sort,
                 ret.instance_variables.sort
  end

  # obj.getAccountActivity(body)
  def test_get_account_activity
    req = AmazonFPS::GetAccountActivity.new
    req.startDate = Date.today
    ret = @fps.getAccountActivity(req).getAccountActivityResult
    assert_not_nil ret
    assert_equal 'GetAccountActivityResult', ret.class.to_s
    assert_equal ["@batchSize"].sort, ret.instance_variables.sort
  end
  
  # obj.settle(body)
  def test_settle
    assert false, "Need to write tests"
  end

  # obj.reserve(body)
  def test_reserve
    assert false, "Need to write tests"
  end

  # obj.installPaymentInstruction(body)
  def test_install_payment_instruction
    assert false, "Need to write tests"
  end

  # obj.getPaymentInstruction(body)
  def test_get_payment_instruction
    assert false, "Need to write tests"
  end


end
